$("#form_transport .error-message").html("").removeClass("red")

<% if remotipart_submitted? %>
  $('#admin_title').html('Manage transports');
  $('#admin_content').html("<%= j render partial: 'transports/transport_created'  %>");
<% else %>
  <% if @transport.errors.any? %>
    <% flash[:alert] = ' Something missing, Please check again!' %>
    $("#flash_message_wrapper").html("<%=j render partial: 'layouts/flash_messages' %>"); 
    $('#prerequisites').collapse('toggle');
    <% @transport.errors.each do | field, message| %>
      $("#<%=j field.to_s %>_error").html("<%=j message %>").addClass("red");
    <% end %>
  <% else %>
    $('#admin_title').html("<%= j 'Manage transports' %>");
    $('#filter_admin').show();
    $('#admin_content').html("<%= j render partial: 'transports/index', locals: { :transports => @transports } %>")
    $("#flash_message_wrapper").html("<%= j render partial: 'layouts/flash_messages' %>");
    <% flash[:notice] = ' transport Room Type successfully created' %>
  <% end %>
<% end %>
